<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Ftpquotalimits filter form base class.
 *
 * @package    filters
 * @subpackage Ftpquotalimits *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseFtpquotalimitsFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'quota_type'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'per_session'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'false' => 'false', 'true' => 'true'))),
      'limit_type'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'soft' => 'soft', 'hard' => 'hard'))),
      'bytes_in_avail'   => new sfWidgetFormFilterInput(),
      'bytes_out_avail'  => new sfWidgetFormFilterInput(),
      'bytes_xfer_avail' => new sfWidgetFormFilterInput(),
      'files_in_avail'   => new sfWidgetFormFilterInput(),
      'files_out_avail'  => new sfWidgetFormFilterInput(),
      'files_xfer_avail' => new sfWidgetFormFilterInput(),
      'name'             => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'quota_type'       => new sfValidatorChoice(array('required' => false, 'choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'per_session'      => new sfValidatorChoice(array('required' => false, 'choices' => array('false' => 'false', 'true' => 'true'))),
      'limit_type'       => new sfValidatorChoice(array('required' => false, 'choices' => array('soft' => 'soft', 'hard' => 'hard'))),
      'bytes_in_avail'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bytes_out_avail'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bytes_xfer_avail' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_in_avail'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_out_avail'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_xfer_avail' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'name'             => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ftpquotalimits_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ftpquotalimits';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'quota_type'       => 'Enum',
      'per_session'      => 'Enum',
      'limit_type'       => 'Enum',
      'bytes_in_avail'   => 'Number',
      'bytes_out_avail'  => 'Number',
      'bytes_xfer_avail' => 'Number',
      'files_in_avail'   => 'Number',
      'files_out_avail'  => 'Number',
      'files_xfer_avail' => 'Number',
      'name'             => 'Text',
    );
  }
}